from kivy.lang import Builder
from kivy.properties import ObjectProperty

from goblinoid.root.goblinscreen import GoblinScreenWithPrevious
from goblinoid.root.goblinrecycleview import GoblinRecycleView
from goblinoid.root.mixins import FeedAnimationMixin

Builder.load_file('goblinoid/profile/activityscreen.kv')


class ActivityScreen(GoblinScreenWithPrevious, FeedAnimationMixin):
    activity_service = ObjectProperty()
    activity_data = ObjectProperty()

    def on_enter(self):
        self.update_activity_data()

    def update_activity_data(self):
        self.activity_data = self.activity_service.get_activity_data()
        self.ids.rv.update_feed_data(self.activity_data)


class ActivityFeed(GoblinRecycleView):
    pass
